<template>
  <router-link class="img-item" tag="li" :to="`${path}/${song.id}`">
    <img :src="song.picUrl" />
    <span class="icon"><i class="fa fa-headphones" aria-hidden="true"></i>{{ song.playCount | formatNum(1) }}</span>
    <h5>{{ song.name }}</h5>
  </router-link>
</template>
<script>
export default {
  props: {
    song: {
      type: Object,
      default: function () {
        return {};
      },
    },
    path:{
      type:String,
      default:""
    },
  },
};
</script>
<style lang="less" scoped>
.img-item {
  // width: 120px;
  // height: 120px;
  margin: 2px;
  // display: inline-block;
  position: relative;
  //   width:33%;
  // color:#333;
  // margin-bottom:16px;
  // position: relative;
  //   background-color: saddlebrown;
  img {
    border-radius: 10px;
    width: 100%;
    display: block;
  }
  .icon {
    position: absolute;
    text-align: right;
    // bottom:25%;
    // left: 0px;
    top: 0;
    right: 0;
    border-radius: 30px;
    color: white;
    font-size: 15px;
    font-weight: 400;
    line-height: 14px;
    padding: 5px 10px 5px 25px;
    background-color: rgba(0, 0, 0, 0.5);
    i {
      font-size: 16px;
      position: absolute;
      line-height: 14px;
      left: 7px;
    }
  }
  h5 {
    width: 150px;
    height: 40px;
    margin-top: 10px;
    line-height: 20px;
    -webkit-line-clamp: 2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }
}
</style>